package com.jvup.gameshow.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.jvup.common.support.base.BaseActivity;
import com.jvup.common.constant.Navigation;
import com.jvup.common.inject.EventControllerInjector;
import com.jvup.common.inject.ViewModelInjector;
import com.jvup.gameshow.R;
import com.jvup.gameshow.controller.ShareIdeaController;
import com.jvup.gameshow.databinding.ActivityShareIdeaBinding;
import com.jvup.gameshow.model.viewModel.impl.ShareIdeaViewModel;
import com.qire.antscore.annotation.RouteMapping;
import com.qire.antsrouter.inject.Autowired;

import net.yslibrary.android.keyboardvisibilityevent.util.UIUtil;

/**
 * 分享创意想法
 */
@RouteMapping(path = Navigation.Page.ShareIdeaPage)
public class ShareIdeaActivity extends BaseActivity<ActivityShareIdeaBinding> {

    @Autowired(injector = ViewModelInjector.class)
    ShareIdeaViewModel viewModel;
    @Autowired(injector = EventControllerInjector.class)
    ShareIdeaController controller;

    @Override
    public int layoutRid() {
        return R.layout.activity_share_idea;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        controller.bindViewModel(viewModel);

        ActivityShareIdeaBinding viewDataBinder = viewDataBinder();

        viewDataBinder.ideaText.requestFocus();
        viewDataBinder.ideaText.postDelayed(()-> UIUtil.showKeyboard(this,viewDataBinder.ideaText),300);
    }

}
